<template>
	<view>
		<u-cell-group :customStyle="custStyle" :border="false">
			<u-cell title="修改资料"
				@tap="!hasLogin ? $refs.toLogin.show() : $common.routeJump(1, 'personal/setPayPassword') " isLink>
			</u-cell>
			<!-- <u-cell title="注销账户" isLink :border="false"
				@tap="!hasLogin ? $refs.toLogin.show() : $common.routeJump(false, 'login/cancellation') "></u-cell> -->
		</u-cell-group>


		<view class="logOut" @tap="modalShow = true">
			退出账户
		</view>

		<u-modal :show="modalShow" width="600rpx" showCancelButton title="提醒" @confirm="logout"
			@cancel="modalShow = false">
			<view slot="default" class="text-c">确定退出登录吗？</view>
		</u-modal>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	import {
		mapMutations
	} from 'vuex'
	export default {

		data() {
			return {
				custStyle: {
					'background-color': '#FFF',
					'padding': '0 20rpx 0 20rpx',
					'margin-top': '20rpx'
				},

				modalShow: false
			};
		},
		onShow() {

		},
		methods: {
			...mapMutations(['removeToken', 'removeUserInfo']),
			logout() {
				this.modalShow = false

				uni.showLoading({
					title: '正在登出...'
				})
				this.removeToken()
				this.removeUserInfo()
				this.$refs.uToast.show({
					message: '登出成功'
				})
				uni.reLaunch({
					url: '/pages/my/my'
				})

			},
		},

	}
</script>
<style>
	page {
		background: #F5F6F8;
	}
</style>

<style lang="scss" scoped>
	/deep/.u-cell__body {
		padding: 15px 10rpx !important;
		font-size: 28rpx;
		color: #333333;
	}

	.logOut {
		width: 684rpx;
		height: 88rpx;
		background: #ff820d;
		border-radius: 44rpx;
		line-height: 88rpx;
		text-align: center;
		position: fixed;
		left: 33rpx;
		bottom: 109rpx;
		font-size: 28rpx;
		color: #FFFFFF;
	}
</style>